package com.lzpu.thymeleafproject.demos.controller;

import com.lzpu.thymeleafproject.demos.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/getAll")
    public String getAllUser(ModelMap map){
        //存储获取的用户信息，将其保存到map中
        map.addAttribute("users", userService.getAll());
        return "show";
    }
}
